<?php
namespace QnuiRings\Controller;
use Think\Controller;
// 软件名称：互动折扣王-连环折扣-倒计时折扣 
// 代码日期：v3.0 2017-5-10
// 作者：杨道泉 
// 文件名：QnuiZhekouAction.class.php 
// 功能： 使用千牛UI发布限时折扣

class QnuiBaseController extends BaseController {
	public function __construct(){
		parent::__construct();
		$VER = C("VERSION");
		$this->assign("timestemp",session("TIMESTEMP"));
		$this->assign("session",session("TOP_SESSION"));
		$this->assign("user_nick",session("VISITOR_NICK"));
		$this->assign("item_code",session("item_code"));
		$this->assign("item_code_str",$VER[session("item_code")]);
		$this->assign("expire_time",session("expire_time")/1000); //操作的到期时间，w2为倒计时30分钟
		$this->assign("expire_time_str",GetTimeInfo(session("expire_time")/1000));
		$this->assign("deadline",session("deadline"));
		$this->assign("deadline_time",strtotime(session("deadline")));
		$this->assign("deadline_str",GetTimeInfo(strtotime(session("deadline")))); //订购的到期时间
		$this->assign("sid",session("SHOP_ID"));
		$this->assign("shop_levle",session("SHOP_LEV"));
		$this->assign("shop_levle_pic",GetCreditString(session("SHOP_LEV")));
		$this->assign("shop_title",session("SHOP_TITLE"));
		$this->assign("shop_icon",session("SHOP_ICON"));
		$this->assign("shop_score",session("SHOP_SCORE"));
		$this->assign("vip_group",session("vip_group"));
		$vip = session("VIP");
		if($vip){
			C('DB_TYPE',$vip['database_type']); // VIP用户专属数据库
			C('DB_HOST',$vip['database_host']); // VIP用户专属数据库
			C('DB_NAME',$vip['database_name']); // VIP用户专属数据库
			C('DB_USER',$vip['database_user']); // VIP用户专属数据库
			C('DB_PWD',$vip['database_password']); // VIP用户专属数据库
			C('DB_PORT',$vip['database_port']); // VIP用户专属数据库
			C('DB_PREFIX',$vip['database_perfix']); // VIP用户专属数据库
		}
	}
	public function index(){
		$this->display("QnuiRings:zhekou");
	}
	public function zhekou(){
		$this->display("QnuiRings:zhekou");
	}
	public function refresh(){
		$code = I("code");
		$L = D("Login");
		$L->code = $code;
		if(!$L->pcCodeLogin()){
			$tpl = "refreshFalse";
			$info=$L->info;
		}
		$this->assign("info",$info);
		$this->assign("url","/index.php/Index/logout");
		$this->display($tpl);
	}
} 